<?php { ?>
    <style type="text/css">
	<?php $detect = new Mobile_Detect(); if ($detect->isMobile()) { ?>
		body{
			background-color:<?php get_option_tree('background_color_mobile', '', true); ?>;  
			background-image:url('<?php get_option_tree('background_for_mobile_devices', '', true); ?>');
			background-repeat:<?php get_option_tree('mobile_repeat', '', true); ?>;
			color:<?php get_option_tree('content_text_color', '', true); ?>;
			font-size:<?php get_option_tree('content_text_font_size', '', true); ?>;
		}
		<?php } else { ?>
		body{
		<?php if ( get_post_meta($post->ID, 'page_color_choice', true) && !is_home() || get_post_meta($post->ID, 'page_image_choice', true) && !is_home())  : ?>
			<?php if ( get_post_meta($post->ID, 'footer_widget_check_bg', true) != 'off' ) {?>
			background-color: <?php echo get_post_meta($post->ID, 'page_color_choice', true) ?> ;
			<?php } else { ?>
			background-image: url('<?php echo get_post_meta($post->ID, 'page_image_choice', true) ?>') ;
			background-color: <?php echo get_post_meta($post->ID, 'page_color_choice', true) ?> ;
			background-repeat: <?php echo get_post_meta($post->ID, 'header_image_repeat', true) ?> ;
			background-position:<?php echo get_post_meta($post->ID, 'page_position_choice', true) ?> ;
			<?php } ?>
		<?php else : ?>
			<?php if ( is_single() && !is_post_type('portfolio')) { 
			$post_term = wp_get_post_terms( $post->ID, 'category' );
			$category_slug = $post_term[0]->slug;
			query_posts(array('post_type' => 'cat_head', 'category_name' => $category_slug ));
			if ( ! have_posts() ) {
				if (get_option_tree('full_width_background', '')) {} else { ?>
					background-image:url('<?php get_option_tree('body_background_image', '', true); ?>');
					background-attachment: <?php get_option_tree('body_image_scroll', '', true); ?>;		
					background-repeat:<?php get_option_tree('body_background_repeat', '', true); ?>;
					background-position:<?php get_option_tree('body_image_position', '', true); ?>;
				<?php } ?> 
				background-color:<?php get_option_tree('body_color', '', true); ?>;  
			<?php } else{ 
				while ( have_posts() ) : the_post();
				if ( get_post_meta($post->ID, 'page_color_choice', true) || get_post_meta($post->ID, 'page_image_choice', true)){
					if ( get_post_meta($post->ID, 'footer_widget_check_bg', true) != 'off' ) {?>
						background-color: <?php echo get_post_meta($post->ID, 'page_color_choice', true) ?> ;
					<?php } else { ?>
						background-image: url('<?php echo get_post_meta($post->ID, 'page_image_choice', true) ?>') ;
						background-color: <?php echo get_post_meta($post->ID, 'page_color_choice', true) ?> ;
						background-repeat: <?php echo get_post_meta($post->ID, 'header_image_repeat', true) ?> ;
						background-position:<?php echo get_post_meta($post->ID, 'page_position_choice', true) ?> ;	
		<?php }}else { 
				if (get_option_tree('full_width_background', '')) {} else { ?>
					background-image:url('<?php get_option_tree('body_background_image', '', true); ?>');
					background-attachment: <?php get_option_tree('body_image_scroll', '', true); ?>;		
					background-repeat:<?php get_option_tree('body_background_repeat', '', true); ?>;
					background-position:<?php get_option_tree('body_image_position', '', true); ?>;
				<?php } ?> 
					background-color:<?php get_option_tree('body_color', '', true); ?>;  
					<?php } endwhile; }	wp_reset_query();
			} else { ?>
				<?php if (get_option_tree('full_width_background', '')) {} else { ?>
				background-image:url('<?php get_option_tree('body_background_image', '', true); ?>');
				background-attachment: <?php get_option_tree('body_image_scroll', '', true); ?>;		
				background-repeat:<?php get_option_tree('body_background_repeat', '', true); ?>;
				background-position:<?php get_option_tree('body_image_position', '', true); ?>;
				<?php } ?> 
				background-color:<?php get_option_tree('body_color', '', true); ?>;  
			<?php } endif; ?> 
		color:<?php get_option_tree('content_text_color', '', true); ?>;
		font-size:<?php get_option_tree('content_text_font_size', '', true); ?>;
		} <?php } ?>

			
		a, ul#filter a {color:<?php get_option_tree('link_color', '', true); ?>;}		
		a:hover {color:<?php get_option_tree('link_hover_color', '', true); ?>;}
		.entry-utility a {color:<?php get_option_tree('meta_link_color', '', true); ?>;}
		.breadcrumbs, .breadcrumbs a{color:<?php get_option_tree('breadcrumb_color', '', true); ?>;}
		ul#filter li.current a { color:<?php get_option_tree('content_text_color', '', true); ?>;}
		
		h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, #rps .col p.recent_post-title a, .su-service-title, .su-heading-shell, .su_au_name {color:<?php get_option_tree('heading_color', '', true); ?>;}
		
		h1{font-size:<?php get_option_tree('h1_size', '', true); ?>;}
		h2{font-size:<?php get_option_tree('h2_size', '', true); ?>;}
		h3{font-size:<?php get_option_tree('h3_size', '', true); ?>;}
		h4{font-size:<?php get_option_tree('h4_size', '', true); ?>;}
		h5{font-size:<?php get_option_tree('h5_size', '', true); ?>;}
		h6{font-size:<?php get_option_tree('h6_size', '', true); ?>;}
		
		#logo img {width:<?php get_option_tree('logo_width', '', true); ?>; height:<?php get_option_tree('logo_height', '', true); ?>;}
		#logo {margin-left:<?php get_option_tree('logo_margin_left', '', true); ?>; margin-bottom:<?php get_option_tree('logo_margin_bottom', '', true); ?>;}
		
		#header {height:<?php get_option_tree('horizontal_menu_height', '', true); ?>;}
		#menu_background, #menu_background .slidemenu ul li ul {background-color:<?php get_option_tree('menu_opt_bg', '', true); ?>;}
		#menu_background .slidemenu ul{font-size:<?php get_option_tree('menu_font_size', '', true); ?>;}
		#menu_background .slidemenu ul li ul{font-size:<?php get_option_tree('submenu_font_size', '', true); ?>;}
		
		#primary .xoxo li .widget-title{font-size:<?php get_option_tree('sidebar_title_size', '', true); ?>;}
		
		#slider_offer{background-color:<?php get_option_tree('offer_background_color', '', true); ?>; border-color:<?php get_option_tree('title_bottom_line_color', '', true); ?>;}
		.slide_offer h1{color:<?php get_option_tree('offer_title_color', '', true); ?>;}
		.slide_offer p{color:<?php get_option_tree('offer_text_color', '', true); ?>;}
					
		#footer-widget-area .widget-area .widget-title {color:<?php get_option_tree('footer_heading_color', '', true); ?>;}
		#footer-widget-area .widget-area ul {color:<?php get_option_tree('footer_content_text_color', '', true); ?>;}
		#footer-widget-area .widget-area ul li ul li a {color:<?php get_option_tree('footer_link_color', '', true); ?>;}
		#footer-widget-area .widget-area ul li ul li a:hover {color:<?php get_option_tree('footer_link_hover_color', '', true); ?>;}
		
		.sliding_sidebar {background-color:<?php get_option_tree('sliding_sidebar_background_color', '', true); ?>;}
		.handle {background-color:<?php get_option_tree('sliding_sidebar_background_color', '', true); ?> !important;}
		#sliding-widget-area {color:<?php get_option_tree('sliding_sidebar_text_color', '', true); ?>;}
		#sliding-widget-area .widget-area .widget-title{color:<?php get_option_tree('sliding_sidebar_heading_color', '', true); ?>;}
		#sliding-widget-area .widget-area ul li ul li a{color:<?php get_option_tree('sliding_sidebar_link_color', '', true); ?>;}
		#sliding-widget-area .widget-area ul li ul li a:hover{color:<?php get_option_tree('sliding_sidebar_link_hover_color', '', true); ?>;}
		
		#copyright{color:<?php get_option_tree('copyright_text_color', '', true); ?>}
		#footer_navigation ul li a, #footer_navigation ul li{color:<?php get_option_tree('footer_menu_link_color', '', true); ?>}
		#footer_navigation ul li a:hover{color:<?php get_option_tree('footer_menu_link_hover_color', '', true); ?>}

		.su-divider-solid {border-color:<?php get_option_tree('sidebar_divider_color', '', true); ?>}
		hr{background-color:<?php get_option_tree('sidebar_divider_color', '', true); ?>}
		
		.contact-form input[type='text'], .contact-form textarea {width:<?php get_option_tree('contact_form_width', '', true); ?>}	
		
		div.orbit-wrapper, #featured{ height: <?php get_option_tree('orbit_height', '', true) ?> !important;}
		input[type='submit'], .contact-form input[type='submit'] , #cancel-comment-reply-link{background-color:<?php get_option_tree('button_background_color', '', true); ?>; color:<?php get_option_tree('button_text_color', '', true); ?>}
		input[type='submit']:hover, .contact-form input[type='submit']:hover , #cancel-comment-reply-link:hover {background-color:<?php get_option_tree('button_hover_background_color', '', true); ?>; color:<?php get_option_tree('button_hover_text_color', '', true); ?>}
		
		h1.entry-title-page, #rps .col p.recent_post-title a, #rps .col a, .slide_offer h1, .breadcrumbs a:hover{color:<?php get_option_tree('page_title_color', '', true); ?>;}
		#footer-widget-area .widget-area ul li ul li, #bottom_elements_background {border-color:<?php get_option_tree('fotter_border_color', '', true); ?>;}
		#bottom_elements_background{background-color:<?php get_option_tree('copy_bg_color', '', true); ?>;}
		#footer-widget-area-background {background-color:<?php get_option_tree('footer_background_color', '', true); ?>;}
		
		<?php if ( is_category()){ ?>
		h1.entry-title a, h1.entry-title-page a, #primary .xoxo li .widget-title a{
		<?php if (get_post_meta($post->ID, 'title_txt_color', true)) {
		echo 'color:', get_post_meta($post->ID, 'title_txt_color', true); } else {
		echo 'color:', get_option_tree('title_link_color'); } ?>;}
		h1.entry-title, h1.entry-title-page, #primary .xoxo li .widget-title {
		<?php if (get_post_meta($post->ID, 'title_txt_color', true)) {
		echo 'color:', get_post_meta($post->ID, 'title_txt_color', true); } else {
		echo 'color:', get_option_tree('title_link_color'); } ?>;
		<?php if (get_post_meta($post->ID, 'title_bg', true)) {
		echo 'background-color:', get_post_meta($post->ID, 'title_bg', true); } else {
		echo 'background-color:', get_option_tree('title_background_color');} ?>;
		<?php if (get_post_meta($post->ID, 'line_bg', true)) {
		echo 'border-color:', get_post_meta($post->ID, 'line_bg', true); } else {
		echo 'border-color:', get_option_tree('title_bottom_line_color'); } ?>;} 
		h1.category-title {
		<?php if (get_post_meta($post->ID, 'cat_title_bg', true)) {
		echo 'background-color:', get_post_meta($post->ID, 'cat_title_bg', true); } else {
		echo 'background-color:', get_option_tree('cat_backgr'); } ?>;
		<?php if (get_post_meta($post->ID, 'cat_title_txt', true)) {
		echo 'color:', get_post_meta($post->ID, 'cat_title_txt', true); } else {
		echo 'color:', get_option_tree('category_title_text_color'); } ?>;} 
		.more-link, #rps .rps_read_more, .entry-utility a:hover{
		<?php if (get_post_meta($post->ID, 'line_bg', true)) {
		echo 'color:', get_post_meta($post->ID, 'line_bg', true); } else {
		echo 'color:', get_option_tree('title_bottom_line_color'); } ?>;} 
		#menu_background .slidemenu ul li a, #menu_background .slidemenu ul li ul a{
		<?php if (get_post_meta($post->ID, 'menu_link_color', true)) {
		echo 'color:', get_post_meta($post->ID, 'menu_link_color', true); } else {
		echo 'color:', get_option_tree('menu_opt_link_color'); } ?>;}
		#menu_background .slidemenu ul li a:hover, #menu_background .slidemenu ul li ul li a:hover{
		<?php if (get_post_meta($post->ID, 'menu_link_hover', true)) {
		echo 'color:', get_post_meta($post->ID, 'menu_link_hover', true); } else {
		echo 'color:', get_option_tree('menu_opt_link_hover'); } ?>;}
		#menu_background .current-menu-item > a{
		<?php if (get_post_meta($post->ID, 'menu_link_hover', true)) {
		echo 'color:', get_post_meta($post->ID, 'menu_link_hover', true). '!important'; } else {
		echo 'color:', get_option_tree('menu_opt_link_hover'). '!important'; } ?>;}
		#footer-widget-area-background {
		<?php if (get_option_tree('line_color_before_footer_area') && get_post_meta($post->ID, 'line_bg', true)) {
			echo 'border-color:', get_post_meta($post->ID, 'line_bg', true); } else {
			echo 'border-color:', get_option_tree('line_color_before_footer_area'); }?>;} 
		<?php } elseif ( is_single() && !is_post_type('portfolio')) {
			if ( get_post_meta($post->ID, 'page_color_choice', true) || get_post_meta($post->ID, 'page_image_choice', true)) { ?>
				h1.entry-title, h1.entry-title-page, #primary .xoxo li .widget-title {background-color:<?php get_option_tree('title_background_color', '', true); ?>; border-color:<?php get_option_tree('title_bottom_line_color', '', true); ?>; color:<?php get_option_tree('title_link_color', '', true); ?>;}
				h1.category-title {background-color: <?php get_option_tree('cat_backgr', '', true); ?>; color:<?php get_option_tree('category_title_text_color', '', true); ?>;}
				h1.entry-title a, h1.entry-title-page a, #primary .xoxo li .widget-title a{color:<?php get_option_tree('title_link_color', '', true); ?>;}
				.more-link, #rps .rps_read_more, .entry-utility a:hover{color:<?php get_option_tree('title_bottom_line_color', '', true); ?>;}
				#menu_background .slidemenu ul li a, #menu_background .slidemenu ul li ul a{color:<?php get_option_tree('menu_opt_link_color', '', true); ?>;}
				#menu_background .slidemenu ul li a:hover, #menu_background .slidemenu ul li ul li a:hover{color:<?php get_option_tree('menu_opt_link_hover', '', true); ?>;}
				#menu_background .current-menu-item > a{color:<?php get_option_tree('menu_opt_link_hover', '', true); ?> !important;}
				#footer-widget-area-background {border-color:<?php get_option_tree('line_color_before_footer_area', '', true); ?>;}
		<?php } else { 
				$post_term = wp_get_post_terms( $post->ID, 'category' );
				$category_slug = $post_term[0]->slug;
				query_posts(array('post_type' => 'cat_head', 'category_name' => $category_slug, 'posts_per_page' => 1 ));
				if ( ! have_posts() ) {?>
					h1.entry-title, h1.entry-title-page, #primary .xoxo li .widget-title {background-color:<?php get_option_tree('title_background_color', '', true); ?>; border-color:<?php get_option_tree('title_bottom_line_color', '', true); ?>; color:<?php get_option_tree('title_link_color', '', true); ?>;}
					h1.category-title {background-color: <?php get_option_tree('cat_backgr', '', true); ?>; color:<?php get_option_tree('category_title_text_color', '', true); ?>;}
					h1.entry-title a, h1.entry-title-page a, #primary .xoxo li .widget-title a{color:<?php get_option_tree('title_link_color', '', true); ?>;}
					.more-link, #rps .rps_read_more, .entry-utility a:hover{color:<?php get_option_tree('title_bottom_line_color', '', true); ?>;}				
					#menu_background .slidemenu ul li a, #menu_background .slidemenu ul li ul a{color:<?php get_option_tree('menu_opt_link_color', '', true); ?>;}
					#menu_background .slidemenu ul li a:hover, #menu_background .slidemenu ul li ul li a:hover{color:<?php get_option_tree('menu_opt_link_hover', '', true); ?>;}
					#menu_background .current-menu-item > a{color:<?php get_option_tree('menu_opt_link_hover', '', true); ?> !important;}
					#footer-widget-area-background {border-color:<?php get_option_tree('line_color_before_footer_area', '', true); ?>;}
				<?php } else {					
					while ( have_posts() ) : the_post(); ?>
					h1.entry-title a, h1.entry-title-page a, #primary .xoxo li .widget-title a{
					<?php if (get_post_meta($post->ID, 'title_txt_color', true)) {
					echo 'color:', get_post_meta($post->ID, 'title_txt_color', true); } else {
					echo 'color:', get_option_tree('title_link_color'); } ?>;}
					h1.entry-title, h1.entry-title-page, #primary .xoxo li .widget-title {
					<?php if (get_post_meta($post->ID, 'title_txt_color', true)) {
					echo 'color:', get_post_meta($post->ID, 'title_txt_color', true); } else {
					echo 'color:', get_option_tree('title_link_color'); } ?>;
					<?php if (get_post_meta($post->ID, 'title_bg', true)) {
					echo 'background-color:', get_post_meta($post->ID, 'title_bg', true); } else {
					echo 'background-color:', get_option_tree('title_background_color');} ?>;
					<?php if (get_post_meta($post->ID, 'line_bg', true)) {
					echo 'border-color:', get_post_meta($post->ID, 'line_bg', true); } else {
					echo 'border-color:', get_option_tree('title_bottom_line_color'); } ?>;} 
					h1.category-title {
					<?php if (get_post_meta($post->ID, 'cat_title_bg', true)) {
					echo 'background-color:', get_post_meta($post->ID, 'cat_title_bg', true); } else {
					echo 'background-color:', get_option_tree('cat_backgr'); } ?>;
					<?php if (get_post_meta($post->ID, 'cat_title_txt', true)) {
					echo 'color:', get_post_meta($post->ID, 'cat_title_txt', true); } else {
					echo 'color:', get_option_tree('category_title_text_color'); } ?>;} 
					.more-link, #rps .rps_read_more, .entry-utility a:hover{
					<?php if (get_post_meta($post->ID, 'line_bg', true)) {
					echo 'color:', get_post_meta($post->ID, 'line_bg', true); } else {
					echo 'color:', get_option_tree('title_bottom_line_color'); } ?>;} 
					#menu_background .slidemenu ul li a, #menu_background .slidemenu ul li ul a{
					<?php if (get_post_meta($post->ID, 'menu_link_color', true)) {
					echo 'color:', get_post_meta($post->ID, 'menu_link_color', true); } else {
					echo 'color:', get_option_tree('menu_opt_link_color'); } ?>;}
					#menu_background .slidemenu ul li a:hover, #menu_background .slidemenu ul li ul li a:hover{
					<?php if (get_post_meta($post->ID, 'menu_link_hover', true)) {
					echo 'color:', get_post_meta($post->ID, 'menu_link_hover', true); } else {
					echo 'color:', get_option_tree('menu_opt_link_hover'); } ?>;}
					#menu_background .current-menu-item > a{
					<?php if (get_post_meta($post->ID, 'menu_link_hover', true)) {
					echo 'color:', get_post_meta($post->ID, 'menu_link_hover', true). '!important'; } else {
					echo 'color:', get_option_tree('menu_opt_link_hover'). '!important'; } ?>;}
					#footer-widget-area-background {
					<?php if (get_option_tree('line_color_before_footer_area') && get_post_meta($post->ID, 'line_bg', true)) {
					echo 'border-color:', get_post_meta($post->ID, 'line_bg', true); } else {
					echo 'border-color:', get_option_tree('line_color_before_footer_area'); }?>;} 
					<?php endwhile;  
				}	wp_reset_query(); 
			}
		} else { ?>
		h1.entry-title, h1.entry-title-page, #primary .xoxo li .widget-title, .su-posts-1 h2 {background-color:<?php get_option_tree('title_background_color', '', true); ?>; border-color:<?php get_option_tree('title_bottom_line_color', '', true); ?>; color:<?php get_option_tree('title_link_color', '', true); ?>;}
		h1.category-title {background-color: <?php get_option_tree('cat_backgr', '', true); ?>; color:<?php get_option_tree('category_title_text_color', '', true); ?>;}
		h1.entry-title a, h1.entry-title-page a, #primary .xoxo li .widget-title a, .su-posts-1 h2 a{color:<?php get_option_tree('title_link_color', '', true); ?>;}
		.more-link, #rps .rps_read_more, .entry-utility a:hover{color:<?php get_option_tree('title_bottom_line_color', '', true); ?>;}
		
		#menu_background .slidemenu ul li a, #menu_background .slidemenu ul li ul a{color:<?php get_option_tree('menu_opt_link_color', '', true); ?>;}
		#menu_background .slidemenu ul li a:hover, #menu_background .slidemenu ul li ul li a:hover{color:<?php get_option_tree('menu_opt_link_hover', '', true); ?>;}
		#menu_background .current-menu-item > a{color:<?php get_option_tree('menu_opt_link_hover', '', true); ?> !important;}
		#footer-widget-area-background {border-color:<?php get_option_tree('line_color_before_footer_area', '', true); ?>;}
		<?php } ?>
		
		@media only screen and (max-device-width: 480px) { .entry-content {font-size:<?php get_option_tree('mobile_text_size', '', true); ?>;} }
    </style>
<?php } ?>